// -*- c++ -*-
//
// rss.h
//
// Copyright (C) 2005 Petter Stokke <ummo@hellokitty.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
//

#ifndef RSS_H
#define RSS_H

#include <qdom.h>
#include <qstring.h>
#include <qvaluelist.h>
#include <qdatetime.h>
#include <kurl.h>

class RSSItem
{
public:
    RSSItem();
    RSSItem( const RSSItem& other );

    bool parse( QDomElement item );

    const QString& title() const;
    const QString& description() const;
    const KURL& link() const;
    const QString& creator() const;
    const QString& subject() const;
    const QDateTime& date() const;

private:
    QString m_title, m_description, m_creator, m_subject;
    KURL m_link;
    QDateTime m_date;
};

class RSSFeed
{
public:
    RSSFeed();

    bool parse( QDomDocument& doc );

    const QString& title() const;
    const KURL& link() const;
    const QString& description() const;

    const QValueList<RSSItem>& items() const;
    uint count() const;

private:
    QString m_title, m_description;
    KURL m_link;
    QValueList<RSSItem> m_items;
};

#endif
